#!/bin/sh

. /lib/lsb/init-functions

case $1 in

   start)

      log_info_msg "Starting sireguard daemon..."

      start_daemon /usr/bin/wg-quick up wg0

      #evaluate_retval

      ;;



   stop)

      log_info_msg "Stopping wireguard daemon..."

      start_daemon /usr/bin/wg-quick down wg0

      #evaluate_retval

      ;;



   restart)

      $0 stop

      sleep 1

      $0 start

      ;;



   status)

      /usr/bin/wg show 

      ;;



   *)

      echo "Usage: $0 {start|stop|restart|status}"

      exit 1

      ;;

esac

